package com.appwoo.txtws.component;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.appwoo.txtws.bean.AutoSoftInfo;
import com.appwoo.txtws.bean.DataBaseUpLoad;
import java.util.ArrayList;

public class OperationSource extends DataBaseUpLoad
{
  private Context context;
  private SQLiteDatabase database = null;

  public OperationSource(Context paramContext)
  {
    this.context = paramContext;
    this.database = super.getDatabase(paramContext);
  }

  public void close()
  {
    if (this.database != null)
      this.database.close();
  }

  public void deleteAllSource()
  {
    this.database.execSQL("delete from upload");
  }

  public void deleteSource(ArrayList<AutoSoftInfo> paramArrayList)
  {
    for (int i = 0; ; i++)
    {
      if (i >= paramArrayList.size())
        return;
      this.database.execSQL("delete from upload where ProcName='" + ((AutoSoftInfo)paramArrayList.get(i)).getAspkg() + "'");
    }
  }

  public void insertInToXT(ArrayList<AutoSoftInfo> paramArrayList)
  {
    for (int i = 0; ; i++)
    {
      if (i >= paramArrayList.size())
        return;
      this.database.execSQL("insert into xtsoft values('" + paramArrayList + "')");
    }
  }

  public void insertSourceToDBFromWeb(ArrayList<AutoSoftInfo> paramArrayList)
  {
    for (int i = 0; ; i++)
    {
      if (i >= paramArrayList.size())
        return;
      this.database.execSQL("INSERT INTO upload VALUES('" + ((AutoSoftInfo)paramArrayList.get(i)).getAspkg() + "','" + ((AutoSoftInfo)paramArrayList.get(i)).getAspkg() + "')");
    }
  }

  public ArrayList<AutoSoftInfo> selectAllDB()
  {
    ArrayList localArrayList = new ArrayList();
    Cursor localCursor = this.database.query("upload", null, null, null, null, null, null);
    while (true)
    {
      if (!localCursor.moveToNext())
        return localArrayList;
      AutoSoftInfo localAutoSoftInfo = new AutoSoftInfo();
      localAutoSoftInfo.setAsname(localCursor.getString(localCursor.getColumnIndex("pkgname")));
      localAutoSoftInfo.setAspkg(localCursor.getString(localCursor.getColumnIndex("ProcName")));
      localArrayList.add(localAutoSoftInfo);
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.component.OperationSource
 * JD-Core Version:    0.6.2
 */